package com.shuoyue.ycgk.ui.mine.learnprogress;

import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;

import com.chad.library.adapter.base.BaseViewHolder;
import com.shuoyue.ycgk.R;
import com.shuoyue.ycgk.base.baseadapter.AppBaseQuickAdapter;

import java.util.Calendar;
import java.util.List;

public class CalenderAdapter extends AppBaseQuickAdapter<DayInfo> {
    Calendar calendar;

    public CalenderAdapter(@Nullable List<DayInfo> data) {
        super(R.layout.item_calendar, data);
        calendar = Calendar.getInstance();
    }

    @Override
    protected void convert(BaseViewHolder helper, DayInfo item) {
        helper.addOnClickListener(R.id.lay_all);
        helper.setText(R.id.text, (item.getDayInMouth()) + "");
        if (item.isSelect) {
            helper.setBackgroundRes(R.id.text, R.drawable.bg_circular_blue);
            helper.setTextColor(R.id.text, ContextCompat.getColor(mContext, R.color.white));
        } else {
            helper.getView(R.id.text).setBackground(null);
            helper.setTextColor(R.id.text, ContextCompat.getColor(mContext, R.color.all_text_gray_color));
        }
    }
}
